﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Edu.Web.Data.DAO;
using Edu.Web.Data.DV;
using Edu.Web.Data.Entity;
using ESoft.Core.Data.DAO;
using ESoft.Core.Data.Service.Impl;

namespace Edu.Web.Data.Service.Impl
{
    public class ApplyService : BaseService<ApplyEntity, long>, IApplyService
    {
        private readonly IApplyDAO _applyDao;

        public ApplyService(IApplyDAO dao) : base(dao)
        {
            _applyDao = dao;
        }

        public List<ApplyDV> GetApplyListByApplyUserId(long applyUserId)
        {
            return _applyDao.GetApplyList().Where(x => x.ApplyUserId == applyUserId).ToList();
        }

        public List<ApplyDV> GetApplyList()
        {
            return _applyDao.GetApplyList().ToList();
        }

        public ApplyDV GetApplyListByApplyId(long applyId)
        {
            return _applyDao.GetApplyList().Where(x => x.Id == applyId).FirstOrDefault();
        }
    }
}